!  F90templates.f90 
!
!  FUNCTIONS:
!  F90templates - Entry point of console application.
!

!****************************************************************************
!
!  PROGRAM: F90templates
!
!  PURPOSE:  Entry point for the console application.
!
!****************************************************************************

PROGRAM F90templates
    USE modA             ! allow access to functions in module modA
    USE modB             ! allow access to functions in module modB

    IMPLICIT NONE        ! let all variables must be manually declared
    REAL(8)  :: X        ! REAL means a real number in mathematics
    REAL(8)  :: Y        ! 8 means 8bytes or double precision
    REAL(8)  :: Z        ! a lower precision alternative is 4.
        

    ! Variables

    ! Body of F90templates
    PRINT *, 'Hello World'

    ! Assign some values to variables    
    X = 4.0d0          ! d symbol means double precision or real(8)
    Y = 10.0d0           ! d0 means 10 to the power of zero
    Z = 0.0d0

    ! calling subroutines from modA module
    call add(X, Y, Z)
    print *, Z
    
    call minus(X, Y, Z)
    print *, Z
    
    ! calling subroutines from modB module
    call multiply(X, Y, Z)
    print *, Z

    call divide(X, Y, Z)
    print *, Z

    
    
    READ *

    STOP
END PROGRAM F90templates

